<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然金融中心管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">
        <div class="row h-home-path">
          <div class="col-md-12">
            <ol class="breadcrumb">
              <li><i class="fa fa-home"></i>&nbsp;&nbsp;所在位置</li>
              <li>首页</li>
              <li class="active">编辑普通贷款合同信息</li>
            </ol>
          </div>
        </div>
        <div class="row h-main-search">
          <form action="javascript:;" method="post">
            <div class="pull-right h-btn-group">
              <button class="btn btn-info" id="return-btn"
                      onclick="returnIndex()">
                <i class="fa fa-mail-reply">&nbsp;&nbsp;</i>返回
              </button>
              <button class="btn btn-info" id="save" onclick="CtrLoanContMgr.submitForm()"
                      type="button">
                <i class="fa fa-save">&nbsp;&nbsp;</i>保存
              </button>
            </div>
          </form>
        </div>

        <div class="form-horizontal  h-form-warp">
          <div class="h-msg-title h-table-header">
            <strong>普通贷款合同信息</strong>
          </div>
          <form action="/ctrLoanCont/saveCtrLoanCont" class="form-horizontal" id="ctrLoanContForm"
                method="post"
                role="form">
            <input id="operation" name="operation" type="hidden"
                   value="${operation}"/> <input class="form-control"
                                                 id="contNo" name="contNo" type="hidden"
                                                 value="${ctrLoanCont.contNo}">
            <div class="form-group">
              <label class="col-sm-2 control-label">合作方编号</label>
              <div class="col-sm-2">
                <input class="form-control" id="partnerId"
                       maxlength="32" name="partnerId"
                       type="text" value="${ctrLoanCont.partnerId}">
              </div>
              <div class="col-sm-2">
                <input name="btn" onclick="CtrLoanContMgr.selectCtrLoanCont()" type="button"
                       value="选择合同编号"/>
              </div>

            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">合同利率</label>
              <div class="col-sm-2">
                <input class="form-control" id="rulingIr"
                       isRate="true"
                       maxlength="32" name="rulingIr" type="text" value="0.323"/>
              </div>
              <label class="col-sm-2 control-label">合同金额</label>
              <div class="col-sm-2">
                <input class="form-control currency" id="contAmt" isCurrency="true"
                       maxlength="32"
                       name="contAmt" type="text" value="1111">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">支付方式</label>
              <div class="col-sm-6" defaultValue='l' dicType='select' dict="loginType"
                   id="loginTypeGroup" length="4" method="CtrLoanContMgr.showTips()" name="loginTypeGroup"
                   required="required"
                   subList='l'
                   value="m">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">验证方式</label>
              <div class="col-sm-6" dicType='select' dict="std_pub_yn" id="payTypeGroup"
                   name="payTypeGroup" required="required">
              </div>
            </div>

            <div class="form-group">
              <label class="col-sm-2 control-label">支付状态</label>
              <div chooseList="l" class="col-sm-2" dicType='checkbox' dict="loginType" id="statusGroup"
                   method="CtrLoanContMgr.showTips()" name="statusGroup" required="required" value="l,m">
              </div>
              <div class="col-sm-1"><label class="required">*</label></div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">币种</label>
              <div class="col-sm-2" dicType="radio" dict="loginType" disabled="disabled" id="currencyTypeGroup"
                   method="CtrLoanContMgr.showTips()" name="currencyTypeGroup" required="required" subList='m'
                   value="m">
              </div>
              <div class="col-sm-1"><label class="required">*</label></div>
            </div>

          </form>
        </div>
      </div>
    </div>
    <!-- end: PAGE -->
  </div>
  <!-- end: MAIN CONTAINER -->


  <!-- 新增 begin -->

</div>
<#include "/common/jslib.html">
<!-- 弹窗下拉 -->
<script type="text/javascript">
    function initValue(selectStr) {
        var arr = selectStr.split(",");
        $("#partnerId").val(arr[0]);
        $("#cusId").val(arr[1]);
        $("#cusName").val(arr[2]);
    }

    function returnIndex() {
        //window.location.href = "/ctrLoanCont/query";
    }

    $(function () {
        // 页面操作类型：add(添加)-edit(编辑)-view(查看)
        var operation = $("#operation").val();
        // 弹出窗体控制
        CtrLoanContMgr = {
            // 初始化
            init: function () {
                initDict(DICTURL, FORM, operation); //初始化数据字典
                initAmtAndRate();//初始化金额和利率
                // 前台验证表单
                $("#ctrLoanContForm").validate();
                // 查看的时候不显示保存按钮
                if (operation == "view") {
                    Jmts.setFormReadOnly();
                }
            },
            // init end
            selectCtrLoanCont: function () {
                /* 调用示例 */
                /* Jmts.openNoticeDialog({
                    title: '商业定制',
                    width: 220,  /*必须指定一个像素宽度值或者百分比，否则浏览器窗口改变可能导致lhgDialog收缩 */
                //height: 100,
                //content: '若需要商业定制，记得联系我噢',
                // time: 5
                //});
                //return false; */
                Jmts.openDialog(
                    "selectCtrLoanCont",
                    "/demo/selectCtrLoanCont?selectType=single&parentController=CtrLoanContMgr",
                    "选择合同", 500, 1000, 32);
            },

            // 提交数据
            submitForm: function () {
                var rulingIr = Jmts.getRateValue($("#rulingIr").val());
                var contAmt = Jmts.getAmtValue($("#contAmt").val());

                Jmts.convertAmtAndRate();//转换金额和利率
                return false;
                Jmts.ajaxSubmit(document.getElementById("ctrLoanContForm"),
                    function (result) {
                        if (result.success) {
                            Jmts.succTips(result.msg);
                        } else {
                            Jmts.warnTips("保存失败");
                        }
                    });
                return false;
            },
            // submitForm end
            showTips: function () {
                Jmts.alert("Hello,EveryBody!");

            },
            showMsg: function () {
                Jmts.alert("加载完成了吗？");
                Jmts.alert($("#loginType option:selected").val());
            }

        };
        // 执行初始化
        CtrLoanContMgr.init();
        // 前台验证表单
        $("#ctrLoanContForm").validate();
    });
</script>

</body>
</html>
